package hoodoos.rule.script.dsl.conf

trait RuleDelegate {

  def rule(@DelegatesTo(strategy = Closure.DELEGATE_ONLY, value = RuleSpec) Closure cl) {
    def rule = new RuleSpec()
    def ruleClosure = cl.rehydrate(rule, this, this)
    ruleClosure.resolveStrategy = Closure.DELEGATE_FIRST
    ruleClosure.call()
    return rule.name + "\t 被拒绝：" +  rule.run()
  }

}
